package com.paradogs.gs.misc;

import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.DefaultValue;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author: yumi
 * @date: 2023/11/20  11:01
 * @Description: DB 实体基类
 */
@Data
@ProtobufClass
public class BaseMgrEntity {

    // 玩家 ID
    @Protobuf(order = 1)
    @TableId(value = "uid", type = IdType.AUTO)
    private Long uid;

    // 创建时间
    @Protobuf(order = 2)
    @DefaultValue("CURRENT_TIMESTAMP")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    // 更新时间
    @Protobuf(order = 3)
    @DefaultValue("NULL ON UPDATE CURRENT_TIMESTAMP")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}
